The present invention relates to a device and a method for determining whether a counter reading of a counter has reached a predetermined value or not.
In order to determine whether the counter reading of the counter has reached a predetermined value, use is normally made of an equal to comparator, by which the counter readings of the counter are each compared with the predetermined value.
Reaching a specific counter reading is, in control and regulating equipment, often the triggering event for the generation of a pulse or an edge. Control and regulating equipment of this type has been known for many years in innumerable embodiments and does not require any more detailed explanation.
However, experience shows that event-controlled pulse or edge generating systems of this type can either be adapted exactly to the individual requirements only with a relatively great effort, or cannot be adapted at all, or in any case not under all circumstances.
It is accordingly an object of the invention to provide a configuration and a method for determining whether the counter reading of a counter has reached a predetermined value or not which overcomes the above-mentioned disadvantages of the prior art devices of this general type, which permit the generation of a pulse or edge which at any time can be adapted individually to various needs.
With the foregoing and other objects in view there is provided, in accordance with the invention, a configuration for determining whether a counter reading of a counter has reached a predetermined counter reading. The configuration contains a means for determining whether the predetermined counter reading has already been reached within a specific time window or not. The means can be configured by varying a magnitude of the specific time window, a position of the specific time window, and/or a quantity of bits to be taken into account in a determination of counter readings to be compared.
Accordingly, the configuration according to the invention and the method according to the invention are distinguished by the fact that the determination or the configuration carrying out the determination can be configured by varying the magnitude and/or position of a time window to be taken into account in the determination and/or by varying the bits to be taken into account in the determination from the counter readings to be compared.
As a result of such configurability of the determination or of the configuration carrying this out, they can be adapted extremely simply and flexibly at any time to the widest range of needs. The configurations and methods for determining whether the counter reading of a counter has reached a predetermined value or not, which hitherto could not be adapted individually at all, or only to a restricted extent, have as a result become configurations and methods which can be used universally and can also be adapted immediately to changing needs.
In accordance with an added feature of the invention, the specific time window is defined relative to the predetermined counter reading. More precisely, the specific time window is defined by a first range lying before the predetermined counter reading and by a second range lying after the predetermined counter reading.
In accordance with an additional feature of the invention, the means contains at least one memory device with a variable content for storing parameters defining the position and the magnitude of the specific time window. The means also includes a memory device with a variable content for storing the predetermined counter reading. Of course the memory devices can be the same memory unit.
In accordance with a further feature of the invention, the means generates a determination result represented by a value based on a comparison of a difference between a current counter reading of the counter and the predetermined counter reading, and on further processing of the difference in dependence on the difference itself and on the specific time window.
In accordance with a another feature of the invention, the further processing of the difference consists in that, for the case in which the difference is positive or equal to zero, the magnitude of the second range lying after the predetermined counter reading is subtracted from the difference. And for the case in which the difference is negative, the magnitude of the first range lying in front of the predetermined counter reading is added to the difference.
In accordance with a further added feature of the invention, the bits to be taken into account in the determination of comparable counter readings are a least significant bit and a variable number of next most significant bits of the counter readings to be compared. The counter readings to be compared are subtracted bit by bit, a generation of a respective difference bit being carried out without taking a carry bit into account, and a generation of a respective carry bit output being carried out with the carry bit being taken into account, the carry bit resulting from the subtraction of next least significant bits of the counter readings.
In accordance with a further additional feature of the invention, the difference bit formed with the carry bit being taken into account is generated for the bits of the counter readings which represent the least significant of the bits not to be taken into account from the counter readings.
In accordance with a concomitant feature of the invention, the difference bit formed with the carry bit being taken into account from the least significant of the bits not to be taken into account from the counter readings is used as the determination result.
With the foregoing and other objects in view there is provided, in accordance with the invention, a method for determining whether a counter reading of a counter has reached a predetermined value. The method includes the steps of determining whether a predetermined counter reading has already been reached within a specific time window; and configuring a determination by varying a magnitude of the specific time window, a position of the specific time window, and/or a number bits to be taken into account of counter readings to be compared during the determination.
Other features which are considered as characteristic for the invention are set forth in the appended claims.
Although the invention is illustrated and described herein as embodied in a configuration and a method for determining whether the counter reading of a counter has reached a predetermined value or not, it is nevertheless not intended to be limited to the details shown, since various modifications and structural changes may be made therein without departing from the spirit of the invention and within the scope and range of equivalents of the claims.
The construction and method of operation of the invention, however, together with additional objects and advantages thereof will be best understood from the following description of specific embodiments when read in connection with the accompanying drawings.